package com.itheima.fanxing;

import com.itheima.domain.Student;

import java.util.ArrayList;

public class Demo01 {

    public static void main(String[] args) {
       /* ArrayList list = new ArrayList();
        list.add(123);
        list.add('A');
        list.add(true);
        list.add("def");
        list.add(new Student("zhangsan",18));

        for (Object o : list) {
            Student s= (Student) o;
            System.out.println(((Student) o).getName());
        }*/
        ArrayList<Student> list = new ArrayList<>();
        list.add(new Student("张三1",18));
        list.add(new Student("张三2",18));
        list.add(new Student("张三3",18));
        list.add(new Student("张三4",18));
            //list.add(123);

        for (Student student : list) {
            System.out.println(student.getName());
        }

        ArrayList<Object> list2 = new ArrayList();
    }
}
